﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using HWmanagementDB;

namespace HWmanagementServer
{
    [DataContract]
    public class LogModel
    {
        [DataMember]
        public int id;
        [DataMember]
        public string userid;
        [DataMember]
        public DateTime date;
        [DataMember]
        public string action;

        public static LOG toDBTable(LogModel lm)
        {
            return new LOG() { ID = lm.id, USERID = lm.userid, DATE=lm.date, ACTION=lm.action };
        }

        public static LogModel fromDBTable(LOG l)
        {
            return new LogModel() { id = l.ID, userid = l.USERID, date=l.DATE, action=l.ACTION };
        }
    }
}
